package com.itbaima.search.repository;

import com.itbaima.search.entity.Student;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

/**
 * <p>StudentRepository</p>
 *
 * @author Chen
 * @since 2023/2/23 18:34:34
 */
@Repository
public interface StudentRepository extends ElasticsearchRepository<Student, Long> {

    /**
     * 根据地址搜索匹配的学生
     *
     * @param address 地址
     * @return 匹配的学生
     */
    Iterable<Student> queryStudentsByAddressMatches(String address);

    Page<Student> queryStudentsByAddressMatches(String address, Pageable pageable);

}
